<template>
    <div>
        <p>{{localCount}}</p>
        <p>{{localCount2}}</p>
        <p>
            <button @click="localIncrementAsync(1)">延迟增加</button>
            <button @click="localIncrement(1)">增加</button>
            <button @click="localDecrement(1)">减少</button>
        </p>
    </div>
</template>
<script>
import { mapState, mapGetters, mapMutations,mapActions } from 'vuex'
export default {
    computed: {
        other() { return 'other'; },
        ...mapState({
            localCount: 'count',
        }),
        ...mapGetters({
            localCount2: 'count2'
        })
    },
    methods: {
        otherMethod() { },
        ...mapMutations({
            localIncrement: 'increment',
            localDecrement: 'decrement'
        }),
        ...mapActions({
            localIncrementAsync:'incrementAsync'
        })
    }
};
</script>

